
#ifndef _CAMERA_H
#define _CAMERA_H

#include <typedef.h>

void camera_init(void); 
void camera(void);
void camera_irq(void);
void CalculateBurstSize(u32, u32 *, u32 *);
void CalculatePrescalerRatioShift(u32, u32, u32 *, u32 *);
void CamCodecIntMask(void);
void CamCodecIntUnmask(void);
void CamCaptureStart(void);

#define C3188A      0x42        // 7 Bit Address + Mode (Read : 0, Write : 1)
#define C3038A      0xC0        // 7 Bit Address + Mode (Read : 0, Write : 1)

#define CLKCON		(*((volatile unsigned long *)(0x4C00000C)))

#define CISRCFMT		(*((volatile unsigned long *)(0x4F000000)))
#define CIWDOFST		(*((volatile unsigned long *)(0x4F000004)))
#define CIGCTRL			(*((volatile unsigned long *)(0x4F000008)))
#define	CICOTRGFMT		(*((volatile unsigned long *)(0x4F000048)))
#define	CICOCTRL		(*((volatile unsigned long *)(0x4F00004C)))
#define CIIMGCPT		(*((volatile unsigned long *)(0x4F0000A0)))
#define CICOSCCTRL		(*((volatile unsigned long *)(0x4F000058)))

#define GPJCON		(*((volatile unsigned long *)(0x560000D0)))
#define GPJDAT		(*((volatile unsigned long *)(0x560000D4)))
#define GPJUP		(*((volatile unsigned long *)(0x560000D8)))

#define CICOYSA1	(*((volatile unsigned long *)(0x4F000018)))
#define CICOYSA2	(*((volatile unsigned long *)(0x4F00001C)))
#define CICOYSA3	(*((volatile unsigned long *)(0x4F000020)))
#define CICOYSA4	(*((volatile unsigned long *)(0x4F000024)))

#define CICOCBSA1	(*((volatile unsigned long *)(0x4F000028)))
#define CICOCBSA2	(*((volatile unsigned long *)(0x4F00002C)))      
#define CICOCBSA3	(*((volatile unsigned long *)(0x4F000030)))      
#define CICOCBSA4	(*((volatile unsigned long *)(0x4F000034)))
#define CICOCRSA1	(*((volatile unsigned long *)(0x4F000038)))
#define CICOCRSA2	(*((volatile unsigned long *)(0x4F00003C)))
#define CICOCRSA3	(*((volatile unsigned long *)(0x4F000040)))
#define CICOCRSA4	(*((volatile unsigned long *)(0x4F000044)))

#define	CAMERA_DMA_ADDRESS		0x32000000

#define CoDstWidth				640
#define CoDstHeight				480

#endif
